<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::post('/login', "Auth\OauthController@login");

Route::middleware('auth:api')->get('/me', function (Request $request) {
    return $request->user();
});

Route::post("/tenant/create", "Tenant\TenantController@create")->name("tenant.create");

Route::middleware('auth:api')->group(function () {
    Route::delete('/logout', "Auth\OauthController@logout");
//   require base_path('routes/api_routes/asset_routes.php');
    foreach (File::allFiles(base_path('routes/api_routes')) as $partial) {
        require $partial->getPathname();
    }
});


